home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crosscountry USA Photo Safari
/
Crosscountry USA Photo Safari.iso
/
Data
/
cc_base
/
pak00_16bit_f.pk3
/
expense.gl.p
< prev
next >
Wrap
Text File
|
2003-09-23
|
16KB
|
401 lines
{
Hidden = TRUE;
ChildID = {
GuiAnimation("background") {
AnimationID = "image/expense.pcx";
X = 0;
Y = 0;
},
GuiTextInput("screen_name") {
X = 30;
Y = 40;
Width = 55;
Height = 20;
FontID = "font/verdana_9.tf";
InputDisabled = TRUE;
InputText = Mangle(306/*"Expenses"*/);
},
GuiLayer("budget") {
X = 81;
Y = 79;
Hidden = FALSE;
FontID = "font/verdana_black_bold_14.tf";
ChildID = {
GuiTextInput("description") {
X = -30;
Y = -5;
Width = 270;
Height = 30;
FontID = "font/verdana_black_bold_18.tf";
InputDisabled = TRUE;
InputHorizontalAlign = CENTER;
InputText = Mangle(307/*"Description"*/);
},
GuiTextInput("Expenditure") {
X = 253;
Y = -5;
Width = 145;
Height = 30;
InputHorizontalAlign = CENTER;
InputDisabled = TRUE;
FontID = "font/verdana_black_bold_18.tf";
InputText = Mangle(308/*"Expenses"*/);
},
GuiTextInput("Income") {
X = 395;
Y = -5;
Width = 120;
Height = 30;
InputHorizontalAlign = CENTER;
InputDisabled = TRUE;
FontID = "font/verdana_black_bold_18.tf";
InputText = Mangle(309/*"Income"*/);
},
GuiTextInput("cost_calculation") {
InputDisabled = TRUE;
ScriptID = script {
@show{
resid Game;
resid Player;
resid fontID;
resid Scenario;
int player_cash;
int food_expense;
int hotel_expense;
int fuel_expense;
int mishap_expense;
int ticket_expense;
int total_expense;
int commodity_revenue;
int bonus_revenue;
int total_revenue;
int commodity_cost;
int bonus_commodity_cost;
int truck_trip_meter_cost;
int truck_lease_cost_per_day;
int truck_meter_cost_per_mile;
int truck_lease_cost;
int truck_lease_total_cost;
str player_cash_str;
str food_expense_str;
str fuel_expense_str;
str hotel_expense_str;
str mishap_expense_str;
str ticket_expense_str;
str total_expense_str;
str commodity_revenue_str;
str bonus_revenue_str;
str total_revenue_str;
str truck_lease_total_cost_str;
fontID = ResByName("font/square_black_on_gray_9.tf");
Game = ResByName("Game");
Player = ResPropGetResID(Game,"game_cur_player");
player_cash = ResPropGetInt(Player, "expense_cash_in_hand");
player_cash_str = StrFormatStr("$ %s",IntToDecimalStr(player_cash,100));
ResPropSetStr(GuiSiblingByName("expense/starting_balance_value"), "InputText", player_cash_str);
commodity_cost = ResPropGetInt(Game,"game_salary_per_commodity");
bonus_commodity_cost = ResPropGetInt(Game,"game_salary_bonus_commodity");
truck_lease_cost_per_day = ResPropGetInt(Game,"game_truck_lease_cost_per_day");
truck_meter_cost_per_mile = ResPropGetInt(Game,"game_truck_meter_cost_per_mile");
food_expense = ResPropGetInt(Player, "expense_spent_on_food");
total_expense += food_expense;
food_expense_str = StrFormatStr("($ %s)", IntToDecimalStr(food_expense,100));
ResPropSetStr(GuiSiblingByName("expense/food_expense_value"), "InputText", food_expense_str);
fuel_expense = ResPropGetInt(Player, "expense_spent_on_fuel");
total_expense += fuel_expense;
fuel_expense_str = StrFormatStr("($ %s)", IntToDecimalStr(fuel_expense,100));
ResPropSetStr(GuiSiblingByName("expense/fuel_expense_value"), "InputText", fuel_expense_str);
hotel_expense = ResPropGetInt(Player, "expense_spent_on_hotel");
total_expense += hotel_expense;
hotel_expense_str = StrFormatStr("($ %s)", IntToDecimalStr(hotel_expense,100));
ResPropSetStr(GuiSiblingByName("expense/hotel_expense_value"), "InputText", hotel_expense_str);
mishap_expense = ResPropGetInt(Player, "expense_spent_on_mishap");
total_expense += mishap_expense;
mishap_expense_str = StrFormatStr("($ %s)", IntToDecimalStr(mishap_expense,100));
ResPropSetStr(GuiSiblingByName("expense/mishap_expense_value"), "InputText", mishap_expense_str);
ticket_expense = ResPropGetInt(Player, "expense_spent_on_ticket");
total_expense += ticket_expense;
ticket_expense_str = StrFormatStr("($ %s)", IntToDecimalStr(ticket_expense,100));
ResPropSetStr(GuiSiblingByName("expense/ticket_expense_value"), "InputText", ticket_expense_str);
/* display truck lease cost */
truck_trip_meter_cost = ResPropGetInt(Player, "truck_trip_meter") * truck_meter_cost_per_mile;
truck_lease_cost = (TimeGetDay(ResPropGetInt(Player, "time_now"))-1) * truck_lease_cost_per_day;
truck_lease_total_cost = (truck_trip_meter_cost + truck_lease_cost)/10;
total_expense += truck_lease_total_cost;
truck_lease_total_cost_str = StrFormatStr("($ %s)", IntToDecimalStr(truck_lease_total_cost,100));
ResPropSetStr(GuiSiblingByName("expense/truck_lease_value"), "InputText", truck_lease_total_cost_str);
total_expense_str = StrFormatStr("($ %s)", IntToDecimalStr(total_expense,100));
ResPropSetStr(GuiSiblingByName("expense/total_expense_value"), "InputText", total_expense_str);
/* display all commodities revenue when user gets to destination */
if (ResPropGetInt(Player, "player_destination_arrived") == 1) {
/* get number of commodity player picked up */
commodity_revenue = ResPropGetInt(Player,"commodity_number_of") * commodity_cost;
/* check bonus commodity */
if (ResPropGetInt(ResPropGetResID(Player, "commodity_bonus"),"commodity_state") == 1) {
commodity_revenue += bonus_commodity_cost;
}
commodity_revenue_str = StrFormatStr("$ %s", IntToDecimalStr(commodity_revenue,100));
ResPropSetStr(GuiSiblingByName("commodity_revenue_value"), "InputText", commodity_revenue_str);
ResPropSetInt(GuiSiblingByName("commodity_revenue_value"), "Hidden", FALSE);
} else {
ResPropSetInt(GuiSiblingByName("commodity_revenue_value"), "Hidden", TRUE);
}
/* display GRAND TOTAL */
total_revenue = player_cash+commodity_revenue+bonus_revenue-total_expense;
if (total_revenue < 0) {
total_revenue *= -1;
total_revenue_str = StrFormatStr("($ %s)", IntToDecimalStr(total_revenue,100));
ResPropSetResID(GuiSiblingByName("total_revenue_value"), "FontID", ResByName("font/verdana_red_bold_14.tf"));
} else {
total_revenue_str = StrFormatStr("$ %s", IntToDecimalStr(total_revenue,100));
ResPropSetResID(GuiSiblingByName("total_revenue_value"), "FontID", ResByName("font/verdana_black_bold_14.tf"));
}
ResPropSetStr(GuiSiblingByName("total_revenue_value"), "InputText", total_revenue_str);
}
};
}, /* END OF COST CALCULATION */
GuiLayer("expense") {
X = 0;
Y = 60;
ChildID = {
GuiTextInput("starting_balance_label") {
X = 40;
Y = -25;
Width = 210;
Height = 25;
InputDisabled = TRUE;
InputText = Mangle(310/*"Starting Balance"*/);
},
GuiTextInput("starting_balance_value") {
X = 400;
Y = -25;
Width = 115;
Height = 25;
InputDisabled = TRUE;
InputHorizontalAlign = RIGHT;
InputText = Mangle(311/*"Starting Balance"*/);
},
GuiTextInput("food_expense_label") {
X = 40;
Y = 10;
Width = 210;
Height = 25;
InputDisabled = TRUE;
InputText = Mangle(312/*"Food Cost"*/);
},
GuiTextInput("food_expense_value") {
X = 265;
Y = 10;
Width = 130;
Height = 25;
FontID = "font/verdana_red_bold_14.tf";
InputHorizontalAlign = RIGHT;
InputDisabled = TRUE;
InputText = "";
},
GuiTextInput("fuel_expense_label") {
X = 40;
Y = 45;
Width = 210;
Height = 25;
InputDisabled = TRUE;
InputText = Mangle(313/*"Fuel / Ferry Cost"*/);
},
GuiTextInput("fuel_expense_value") {
X = 265;
Y = 45;
Width = 130;
Height = 25;
FontID = "font/verdana_red_bold_14.tf";
InputHorizontalAlign = RIGHT;
InputDisabled = TRUE;
InputText = "";
},
GuiTextInput("hotel_expense_label") {
X = 40;
Y = 82;
Width = 210;
Height = 25;
InputDisabled = TRUE;
InputText = Mangle(314/*"Lodging Cost"*/);
},
GuiTextInput("hotel_expense_value") {
X = 265;
Y = 80;
Width = 130;
Height = 25;
FontID = "font/verdana_red_bold_14.tf";
InputHorizontalAlign = RIGHT;
InputDisabled = TRUE;
InputText = "";
},
GuiTextInput("mishap_expense_label") {
X = 40;
Y = 120;
Width = 210;
Height = 25;
InputDisabled = TRUE;
InputText = Mangle(315/*"Mishap Cost"*/);
},
GuiTextInput("mishap_expense_value") {
X = 265;
Y = 120;
Width = 130;
Height = 25;
FontID = "font/verdana_red_bold_14.tf";
InputHorizontalAlign = RIGHT;
InputDisabled = TRUE;
InputText = "";
},
GuiTextInput("ticket_expense_label") {
X = 40;
Y = 155;
Width = 210;
Height = 25;
InputDisabled = TRUE;
InputText = Mangle(316/*"Ticket Cost"*/);
},
GuiTextInput("ticket_expense_value") {
X = 265;
Y = 155;
Width = 130;
Height = 25;
FontID = "font/verdana_red_bold_14.tf";
InputHorizontalAlign = RIGHT;
InputDisabled = TRUE;
InputText = "";
},
GuiTextInput("truck_lease_label") {
X = 40;
Y = 190;
Width = 210;
Height = 25;
InputDisabled = TRUE;
InputText = Mangle(317/*"Truck Lease"*/);
},
GuiTextInput("truck_lease_value") {
X = 265;
Y = 190;
Width = 130;
Height = 25;
InputHorizontalAlign = RIGHT;
FontID = "font/verdana_red_bold_14.tf";
InputDisabled = TRUE;
InputText = "";
},
GuiTextInput("total_expense_label") {
X = 128;
Y = 260;
Width = 130;
Height = 25;
InputHorizontalAlign = RIGHT;
InputDisabled = TRUE;
InputText = Mangle(318/*"Total Expenses"*/);
},
GuiTextInput("total_expense_value") {
X = 265;
Y = 260;
Width = 130;
Height = 25;
FontID = "font/verdana_red_bold_14.tf";
InputHorizontalAlign = RIGHT;
InputDisabled = TRUE;
InputText = "";
}
}; /* END OF COST ChildID */
}, /* END OF COST GUILAYER */
GuiAnimation("truck_lease_icon") {
X = -15;
Y = 251;
AnimationID = "gui/laptop/laptop_tab/truck_lease.pcx";
},
GuiAnimation("commodity_revenue_icon") {
X = -13;
Y = 286;
AnimationID = "gui/laptop/laptop_tab/commodity.pcx";
ScriptID = script {
@show {
resid Player;
resid Commodity_bonus;
Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
Commodity_bonus = ResPropGetResID(Player, "commodity_bonus");
if (ResPropGetInt(Commodity_bonus, "commodity_state") == 1) {
ResPropSetResID(SELF, "AnimationID", ResByName("gui/laptop/laptop_tab/commodity_bonus.pcx"));
}
}
};
},
GuiTextInput("commodity_revenue_label") {
X = 40;
Y = 288;
Width = 210;
Height = 25;
FontID = "font/verdana_black_bold_14.tf";
InputDisabled = TRUE;
InputText = Mangle(319/*"Commodity Revenue"*/);
},
GuiTextInput("commodity_revenue_value") {
X = 400;
Y = 288;
Width = 115;
Height = 25;
InputHorizontalAlign = RIGHT;
FontID = "font/verdana_black_bold_14.tf";
InputDisabled = TRUE;
InputText = "";
},
GuiTextInput("revenue_label") {
X = 109;
Y = 345;
Width = 150;
Height = 25;
FontID = "font/verdana_black_bold_14.tf";
InputDisabled = TRUE;
InputHorizontalAlign = RIGHT;
InputText = Mangle(320/*"Total Revenue"*/);
},
GuiTextInput("total_revenue_value") {
X = 295;
Y = 345;
Width = 220;
Height = 25;
InputHorizontalAlign = RIGHT;
FontID = "font/verdana_black_bold_14.tf";
InputDisabled = TRUE;
InputText = "";
}
}; /* END OF BUDGET ChildID */
} /* END OF BUDGET */
}; /* END OF MAIN ChildID */
}